package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.ShopClassifyBean;
import com.lwj.liwanjia.impl.ShopClassifyView;
import com.lwj.liwanjia.model.ShopClassifyModel;

import rx.Subscriber;

/**
 * Created by Administrator on 2018/1/17.
 */

public class ShopClassifyPresenter {
    private ShopClassifyModel shopClassifyModel;
    private ShopClassifyView shopClassifyView;

    public ShopClassifyPresenter(ShopClassifyView shopClassifyView) {
        this.shopClassifyView = shopClassifyView;
        shopClassifyModel = new ShopClassifyModel();
    }

    public void getShopClassify() {
        shopClassifyModel.getShopClassify(new Subscriber<ShopClassifyBean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                shopClassifyView.showError((Exception) e);
            }

            @Override
            public void onNext(ShopClassifyBean shopClassifyBean) {
                shopClassifyView.getShopClassify(shopClassifyBean);
            }
        });
    }
}
